import { http } from '@/utils/http' // 引入封装的http
import type { BannerItem, ClassifyNavItem, HotPanelItem, GuessLikeItem } from '@/types/home' // 引入类型
import type { PageParams, PageResult } from '@/types/global'

// 获取轮播图
export const getHomeBanner = (type = 1) => {
  return http<BannerItem[]>({
    url: '/home/banner',
    data: {
      distributionSite: type,
    },
  })
}
// 获取分类导航
export const getHomeClassify = () => {
  return http<ClassifyNavItem[]>({
    url: '/home/category/mutli',
  })
}
// 获取热门面板数据
export const getHomeHotPanel = () => {
  return http<HotPanelItem[]>({
    url: '/home/hot/mutli',
  })
}
// 猜你喜欢列表数据
export const getHomeGoodsGuessLike = (data: PageParams) => {
  return http<PageResult<GuessLikeItem>>({
    url: '/home/goods/guessLike',
    data,
  })
}
